<template>
  <a-layout style="height:100%">
    <a-layout-sider v-model:collapsed="collapsed" :trigger="null" collapsible>
      <div class="logo" >
        <a-avatar
                shape="square"
                size="large"
                :style="{ backgroundColor: color, verticalAlign: 'middle',width: '100%' }"
        >
          {{ avatarValue }}
        </a-avatar>
      </div>
      <a-menu v-model:selectedKeys="selectedKeys" theme="dark" mode="inline">
        <a-menu-item key="1">
          <menu-outlined />
          <span>首页</span>
        </a-menu-item>
        <a-menu-item key="2">
          <apartment-outlined />
          <span>组织用户</span>
        </a-menu-item>
        <a-menu-item key="3">
          <user-outlined  />
          <span>角色</span>
        </a-menu-item>
      </a-menu>
    </a-layout-sider>
    <a-layout>

        <a-layout-header style="background: #fff; padding: 0">
          <span style="margin-left: -1260px;">
          <menu-unfold-outlined
                  v-if="collapsed"
                  @click="() => (collapsed = !collapsed)"
          />
          <menu-fold-outlined v-else  @click="() => (collapsed = !collapsed)" />
           </span>
        </a-layout-header>

      <a-layout-content
              :style="{ margin: '5px 4px', padding: '5px', background: '#fff', minHeight: '650px' }">
        <a-breadcrumb>
          <a-breadcrumb-item>首页</a-breadcrumb-item>
          <a-breadcrumb-item><a href="">列表</a></a-breadcrumb-item>
        </a-breadcrumb>

      </a-layout-content>
    </a-layout>
  </a-layout>
</template>
<script>
  import {
    UserOutlined,
    VideoCameraOutlined,
    UploadOutlined,
    MenuOutlined,
    ApartmentOutlined,
    MenuUnfoldOutlined,
    MenuFoldOutlined,
  } from '@ant-design/icons-vue';
  import {defineComponent,ref} from 'vue'

  const UserList = ['chenjiangbo', 'Lucy', 'Tom', 'Edward'];
  export default defineComponent({

    components: {
      UserOutlined,
      VideoCameraOutlined,
      UploadOutlined,
      MenuOutlined,
      ApartmentOutlined,
      MenuUnfoldOutlined,
      MenuFoldOutlined,

    },

    setup() {
      const avatarValue = ref(UserList[0]);
      return{
        selectedKeys: ref([2]),
        collapsed: ref(false),
        avatarValue,
      }
    }
  })
</script>

<style>
  .logo {
    height: 32px;
    background: rgba(255, 255, 255, 0.3);
    margin: 16px;
  }
  .trigger {
    font-size: 18px;
    line-height: 64px;
    padding: 0 24px;
    cursor: pointer;
    transition: color 0.3s;
  }
  #components-layout-demo-custom-trigger .trigger:hover {
    color: #1890ff;
  }

  .site-layout .site-layout-background {
    background: #fff;
  }
</style>
